#!/usr/bin/env bash
# Copyright (c) 2026 Ruslan Kireev. All rights reserved.
set -euo pipefail
if [ -z "${DOTNET_ROOT:-}" ]; then
    for runtime in "$HOME/.dotnet" /usr/local/share/dotnet /opt/homebrew/lib/dotnet; do
        if [ -x "$runtime/dotnet" ]; then export DOTNET_ROOT="$runtime"; break; fi
    done
fi
# PACE-protected plug-ins load in seconds instead of minutes (MacExceptionMode.cs).
export PAL_MachExceptionMode="${PAL_MachExceptionMode:-2}"
exec "$(cd "$(dirname "$0")" && pwd)/GASMusicStudioHost" "$@"
